import { getEnergyConsumption } from '@/api/energyConsumption';

export default {
  data () {
    return {
      gridItemOneData: [],
    }
  },
  methods: {
    async getGridItemOneData () {
      return getEnergyConsumption(this.getParams()).then(res => {
        (res.data || []).forEach(item => {
          if (item.data == null) {
            item.data = '-'
          }
          if (item.yoy == null) {
            item.yoy = '-'
          }
          if (item.mom == null) {
            item.mom = '-'
          }
        })
        this.gridItemOneData = res.data;
      })
    }
  }
}
